<template>
<table>
    <tr>
        <td>用户名</td>
        <td><input type="text" v-model="UserName"></td>
    </tr>
    <tr>
        <td>密码</td>
        <td><input type="password" v-model="Upwd"></td>
    </tr>
    <tr>
        <td colspan="2"><button @click="Login">登录</button></td>
    </tr>
</table>
</template>
<script setup lang="ts">
import axios from 'axios';
import {ref} from 'vue'
const UserName=ref()
const Upwd=ref()
const Login=()=>{
    axios.get('https://localhost:44312/api/Lx/Login',
    {params:
        {
            UserName:UserName.value,
            Upwd:Upwd.value
        } 
    }
).then(res=>{
    if(res.data>0){
        alert("登录成功")
    }else{
        alert("登录失败")
    }
})
.catch(err=>{
    console.log(err)
})
}

</script>